package com.headFirstModel.commandPattern.action;

/**
 * 吊扇
 */
public class CeilingFan {
    public static final int HIGH=3;
    public static final int MEDIUM=2;
    public static final int LOW=1;
    public static final int OFF=0;
    String location;
    int speed; //代表吊扇当前速度

    public CeilingFan(String location){
        this.location=location;
        speed=OFF;

    }

    //设置高转速
    public void high(){
        speed=HIGH;
        System.out.println("高速运行...");
    }

    //设置中速
    public void medium(){
        speed=MEDIUM;
        System.out.println("中速运行...");
    }

    //设置低速
    public void low(){
        speed=LOW;
        System.out.println("低速...");
    }

    //关闭电扇
    public void off(){
        speed=OFF;
        System.out.println("关闭...");
    }

    //获取吊扇当前速度
    public int getSpeed(){
        return  speed;
    }
}
